package com.my.test.design.chainofresponsibility;

public class HeadMaster extends Leader {

    public HeadMaster(String name) {
        super(name);
    }

    @Override
    public void handRequest(Request request) {

        if (request.getDays()>=0 && request.getDays()<=2){
            System.out.println("I agree:"+this.getName());
        } else {
            this.setNextLeader(new Director("王主任"));
            getNextLeader().handRequest(request);
        }
    }
}
